package mudfox.repository;

import mudfox.entity.Position;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.jpa.repository.Query;

public interface PositionRepository extends CrudRepository<Position, Integer> {
    Iterable<Position> findByTopic(String topic);

    Iterable<Position> findByLabelContaining(String label);

    @Query(value = "select topic from td_position group by topic", nativeQuery = true)
    Iterable<String> getTopics();
}
